package view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;

import common.MyApp;
import common.UserConfig;

/**
 * Created by sshong on 15/6/16.
 */
public class MainBottomTab extends FrameLayout {
    public MainBottomTab(Context context) {
        super(context);
    }

    public MainBottomTab(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MainBottomTab(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public MainBottomTab(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public void setSelected(boolean selected) {
        super.setSelected(selected);
        ImageView imageView = (ImageView) getChildAt(1);
        if (imageView != null) {
            int level = selected ? MyApp.getMyTheme().getId() : 0;
            imageView.setImageLevel(level);
        }
    }
}
